/**
 * @author schranz
 */
package com.nikitova.craps3d.controller 
{
	import com.nikitova.craps3d.constants.Notifications;
	import com.nikitova.craps3d.constants.statemachine.StateActions;
	import com.nikitova.craps3d.model.ConfigProxy;
	import com.nikitova.craps3d.model.GameConfigProxy;
	import com.nikitova.craps3d.model.MaterialsProxy;
	import com.nikitova.craps3d.model.ModelsProxy;

	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
	import org.puremvc.as3.multicore.utilities.startupmanager.model.StartupMonitorProxy;

	public class InitializeProxiesCommand extends SimpleCommand 
	{
		

		override public function execute( note : INotification ) : void
		{
			var gameConfigProxy : GameConfigProxy = facade.retrieveProxy(GameConfigProxy.NAME) as GameConfigProxy;		
			var materialsProxy : MaterialsProxy = facade.retrieveProxy(MaterialsProxy.NAME) as MaterialsProxy;
			var modelsProxy : ModelsProxy = facade.retrieveProxy(ModelsProxy.NAME) as ModelsProxy;
			switch (note.getName())
			{
				case Notifications.INIT_CONFIG:
					var config:ConfigProxy = facade.retrieveProxy( ConfigProxy.NAME ) as ConfigProxy;				
					gameConfigProxy.gameConfigXMLPath = config.gameConfigXmlPath;
					materialsProxy.swfPath = config.swfDir;
					modelsProxy.models = config.models;
					modelsProxy.daePath = config.daeDir;
				break;

				case Notifications.INIT_GAME_CONFIG:
					
				break;
				
				case StartupMonitorProxy.LOADING_COMPLETE:
					sendNotification(Notifications.SHOW_GAME);
				break;
			}
		}
	}
}
